package com.bootcamp.servlet.refresh;

/**
 * @program: wrok-1101
 * @description: ${description}
 * @author: Keyu Li
 * @create: 2021-11-02 14:44
 **/

import javax.servlet.*;
import javax.servlet.http.*;
import javax.servlet.annotation.*;
import java.io.IOException;
import java.util.Date;

@WebServlet(name = "RefreshServlet", value = "/RefreshServlet")
public class RefreshServlet extends HttpServlet {
    @Override
    protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        response.getWriter().println(new Date());
        response.setHeader("refresh","2;url="+request.getContextPath()+"/register");
    }

    @Override
    protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {

    }
}
